<?php
my_component_load('testing' , false);
my_component_load('paging' , false);   
my_component_load('keluarga_jabatan_detail' );
$task = isset($_GET['task']) ? $_GET['task'] : ""; 
$id = isset( $_GET['id'] ) ? $_GET['id']:  0;
$kid = isset( $_GET['kid'] ) ? $_GET['kid']:  0; 

if($_SERVER['REQUEST_METHOD'] == "POST" ):
//	$validatepost = form_pendidikan_validate();
	switch($task){
		case   "pendidikancreate" :
			if($validatepost){
				$errors = message_multi_error($validatepost);
				$content = $errors;
				$content .= form_pendidikan_create($id);
				generate_my_web($content,"","plain.php");
				exit; 
			}else{
				form_pendidikan_submit($id);
				$content =  "Updated";
				generate_my_web($content,"","plain.php");
				exit;
			}
		break;
		case   "create" :
			form_jabatan_keluarga_kompetensi_submit($kid,$id);
			$content =  "Updated";
			generate_my_web($content,"","plain.php");
			exit;
		break;
	}

else: 	
	if($task == "edit"){
		$title= ($id > '0' ) ?  "Perubahan data kompetensi" : "Tambah data kompetensi";
		facebox_page('index.php?com=keluarga_jabatan_detail&task=create&kid='.$kid.'&id='.$id , $title , 280	); 
	}elseif($task == "create"){  
		$content  = form_keluarga_jabatan_create($kid,$id);
		generate_my_web($content,"","plain.php");
		exit; 
	}elseif($task == 'delete'){ // DELETE ITEM	
		remove_job_family($id); 
		my_direct($_SERVER['HTTP_REFERER']);
	}else{
		$pagename = "Informasi detail keluarga jabatan";
		load_facebox_script();
		$content =  view_keluarga_jabatan_detail( $kid); 
	}
endif;  
 generate_my_web($content,  $pagename );
?>